package com.psbc.redislock.exception;

import com.psbc.redislock.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(RateLimitException.class)
    public Result rateLimitException(RateLimitException e) {
        return Result.NO(e.getMessage());
    }
}
